import Vue from "vue";
import Vuex from "vuex";
import moduleA from "./moduleA";

Vue.use(Vuex);
import vuexPer from "vuex-persistedstate";
export default new Vuex.Store({
  strict: true,
  //严格模式开了之后 只能用 mutation修改state
  state: {
    name: "小明",
    age: 19,
    token: "",
  },
  getters: {},
  mutations: {
    change(state, val) {
      state.name = val;
    },
    setToken(state, val) {
      state.token = val;
    },
  },
  actions: {},
  modules: {
    a: moduleA,
  },
  plugins: [vuexPer()],
});
